package com.example.doctor.jpa;

import com.example.common.entity.DoctorBaseInfo;
import org.springframework.data.repository.query.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Optional;

public interface DoctorBaseInfoRepository extends JpaRepository<DoctorBaseInfo ,Long> {

    @Query(value = "SELECT * FROM doctor_base_info WHERE phone =:tel",nativeQuery = true)
    DoctorBaseInfo findByPhone(@Param("tel") String tel);

    DoctorBaseInfo findByOpenId(String openid);


    @Query(value = "SELECT * FROM doctor_base_info WHERE dc_id =:dcId",nativeQuery = true)
    DoctorBaseInfo findByDcId(@Param("dcId") Long dcId);
}
